<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
</script>
    <div class="content-wrap">
        <div class="wrapper" style="bottom: 50px;">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#" >过期药品统计</a>
                </li>
            </ul>
            <section class="panel panel-default">
                <div class="panel-body">
                    <div class="table-responsive no-border">
                        <div class="datatable-top">
                            <div class="pull-left">
                                <form:form id="searchForm" modelAttribute="drugStock"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/drug/drugExpiredStatistics/index');" method="post" class="form-inline">
                                    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <div class="form-group"><label>药品名称:&nbsp;&nbsp;</label><form:input path="drugName" maxlength="50" class="form-control"></form:input></div>
                                    <div class="form-group"><label>过期时间:&nbsp;&nbsp;</label><input name="expireDate" id="expireDate" value='<fmt:formatDate value="${drugStock.expireDate}" pattern="yyyy-MM-dd"/>'  htmlEscape="false" class="form-control Wdate" onfocus="WdatePicker({isShowClear:false,readOnly:true,dateFmt:'yyyy-MM-dd'})" data-parsley-required="true"/></div>
                                    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                </form:form>
                            </div>
                        </div>
                        <table id="contentTable" class="table table-bordered mg-t datatable">
                            <thead>
                                <tr>
                                        <th>库房名称</th>
                                        <th>药品名称</th>
                                        <th>药品包装规格</th>
                                        <th>单位</th>
                                        <th>药品厂商</th>
                                        <th>有效期时间</th>
                                        <th>数量</th>
                                </tr>
                            </thead>
                            <tbody>
                            <c:forEach items="${page.list}" var="drugStock">
                                <tr>
                                        <td> ${drugStock.storageNames}</td>
                                        <td> ${drugStock.drugNames}</td>
                                        <td> ${drugStock.packageSpec}</td>
                                        <td> ${fns:getDictLabels(drugStock.packageUnits, 'SPEC_UNIT', '')}</td>
                                        <td> ${drugStock.supplierJcs}</td>
                                        <td> <fmt:formatDate value="${drugStock.expireDate}" pattern="yyyy-MM-dd"/></td>
                                        <td> ${drugStock.quantity/drugStock.packageNum}</td>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                </div>
            </section>
        </div>
    </div>